<?php
namespace Admin\Controller;
use Think\Controller;
class CateController extends CommonController {
    public function add(){

        if(IS_POST){

             $res=D('cate')->add(I('post.'));
             if($res){
            $this->success('新增成功', 'lists');die;
            } else {    //错误页面的默认跳转页面是返回前一页，通常不需要设置
                $this->error('新增失败');}die;
        }
        $goods_type=D('goods_type')->select();
        $this->assign('goods_type',$goods_type);
        $this->display();
    }
    //列表
    public function lists(){
        $list=D('cate')->relation(true)->select();
        $this->assign('list',$list);
        $this->display();
    }
    //编辑
    public function edit(){
        $this->display();
    }
    public function add_point(){
        if(IS_POST){
            $_POST['up_time']=strtotime(I('post.up_time'));
            $_POST['down_time']=strtotime(I('post.down_time'));
            $res=D('banner_point')->add(I('post.'));
            if($res){
            $this->success('新增成功', 'point_list');die;
            } else {    //错误页面的默认跳转页面是返回前一页，通常不需要设置
                $this->error('新增失败');}die;
        }

        $this->display();
    }
     public function point_list(){
        $admin=D('Banner_point');
        $list=$admin->select();
        $this->assign('list',$list);
        $this->display();
    }

}